﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Shop.Core.Domain.Customers;
using Shop.Core.Properties;

namespace Shop.Core.Domain.Orders
{
    public class CustomerEdittingNode : BaseFlowNode
    {
        public override bool CanPay(Order order)
        {
            return order.PaymentStatus != Payments.PaymentStatues.PaymentComfired;
        }

        public override bool CanEdit(Order order)
        {
            return order.OrderStatus == OrderStatus.CustomerEditting;
        }

        public override void EndEdit(Order order)
        {
            order.ProduceLockStatus = ProduceLockStatus.None;
            this.FlowToNext(order);
        }

        public override bool CanCancel(Order order)
        {
            return this.CanEdit(order);
        }

        public override OrderStatus StatusCode
        {
            get
            {
                return OrderStatus.CustomerEditting;
            }
        }
    }
}
